import {createApp} from "vue";
import App from "./App";
import store from './store'
import {createI18n} from 'vue-i18n'
import cuCustom from '@/components/colorui/components/cu-custom'
import * as storage from '@/util/storage'
import BaseRes from "./api/BaseRes";

import zh from '@/assets/lang/zh'
import en from '@/assets/lang/en'

const app = createApp(App);
app.component('cu-custom', cuCustom)

/**
 * 语言
 */
const defaultLanguage = 'zh'
const language = storage.getLanguage() || defaultLanguage
const i18n = createI18n({
    locale: language, // 默认选择的语言
    fallbackLocale: defaultLanguage,
    silentFallbackWarn: true, //抑制警告
    messages: {zh,en}
})
app.use(i18n)

app.use(store)
app.mount('#app')